package com.pktechan.api.sendMiniMessage.enumration;

/**
 * @program: gsExpress
 * @description: 发送微信公众号模板消息枚举
 * @author: qx.zhang
 * @create: 2020-02-28 18:20
 **/
public enum SendMiniMessageEnum {
    CUSTOMER_ORDER_DELIVERY(1, "客户接收-配送商-已接单-订单配送通知"),
    CUSTOMER_DELIVERY_COMPLETE(2, "客户接收-配送商-完成配送-配送完成通知"),
    CUSTOMER_BINDING_SUCCESS(3, "推荐人接收-客户-完成手机号注册-绑定成功通知"),
    REFERRER_ORDER_PAY(4, "推荐人接收-客户-完成支付-推荐人业绩待确认-新订单提醒"),
    REFERRER_ORDER_COMPLETE(5, "推荐人接收-配送商-完成配送-推荐人业绩确认-新订单提醒"),
    REFERRER_COMMISSION_CONFIRM(6, "推荐人接收-厂家-佣金提现确认-提现成功通知"),
    DISTRIBUTOR_ORDER_DELIVER_REMIND(7, "配送商接收-客户-完成支付-配送商待发货提醒-订单待发货提醒"),
    DISTRIBUTOR_ORDER_TRANSFER_APPLY(8, "配送商接收-配送商-配送单转让-申请-配送商订单转入发货提醒-订单发货通知"),
    DISTRIBUTOR_INTEGRAL_INTO(9, "配送商接收-配送商-转让换货余额-积分兑换物品-积分通知"),
    DISTRIBUTOR_CARRIAGE_CONFIRM(10, "配送商接收-厂家-运费提现确认-提现成功通知"),
    FACTORY_ORDER_PAY(11, "厂家接收-客户-完成支付-订单支付成功通知"),
    FACTORY_ORDER_DELIVERY(12, "厂家接收-配送商-已接单-订单派送提醒"),
    FACTORY_ORDER_TRANSFER_CONFIRM(13, "厂家接收-配送商-订单转让确认-订单配送通知"),
    FACTORY_DELIVERY_COMPLETE(14, "厂家接收-配送商-完成配送-配送完成通知"),
    FACTORY_REFERRER_COMMISSION_APPLY(15, "厂家接收-推荐人-佣金提现-提现申请通知"),
    FACTORY_CARRIAGE_APPLY(16, "厂家接收-配送商-运费提现-提现申请通知");

    private Integer id;

    /**
     * 模板说明
     */
    private String desc;


    SendMiniMessageEnum(Integer id, String desc) {
        this.id = id;
        this.desc = desc;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }


    public static String getMiniMessageNameByCode(Integer id) {

        for (SendMiniMessageEnum sendMiniMessageEnum : SendMiniMessageEnum.values()) {
            if (sendMiniMessageEnum.id.equals(id)) {
                return sendMiniMessageEnum.desc;
            }
        }
        return null;
    }

    /**
     * 根据code查询枚举
     * * @return
     */
    public static SendMiniMessageEnum getSendMiniMessageEnumByCode(Integer id) {
        for (SendMiniMessageEnum sendMiniMessageEnum : SendMiniMessageEnum.values()) {
            if (sendMiniMessageEnum.id.equals(id)) {
                return sendMiniMessageEnum;
            }
        }
        return null;
    }

}
